//
//  LeftHomeViewController.m
//  ASHT_IOS
//
//  Created by 宋安安 on 14-4-3.
//  Copyright (c) 2014年 宋安安. All rights reserved.
//

#import "LeftHomeViewController.h"
#import "AboutViewController.h"

@interface LeftHomeViewController ()

@end

@implementation LeftHomeViewController
@synthesize mainTabBar;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        mainTabBar=[[MainTabBarContentViewController alloc]initWithNibName:@"MainTabBarContentViewController" bundle:nil];
        
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self.navigationController setNavigationBarHidden:YES];
    btn_01.selected=YES;
    // Do any additional setup after loading the view from its nib.
//    self.view.backgroundColor=[UIColor brownColor];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(IBAction)btn_01_onClick:(id)sender
{
    [self btn_selected_no];
    btn_01.selected=YES;
    self.viewDeckController.centerController = mainTabBar;
    self.view.userInteractionEnabled = YES;
    [mainTabBar.tabBar setSelectedIndex:0];
    [self.viewDeckController toggleLeftViewAnimated:YES];
}
-(IBAction)btn_02_onClick:(id)sender
{
    [self btn_selected_no];
    btn_02.selected=YES;
//    btn_02.enabled=NO;
    
    self.viewDeckController.centerController = mainTabBar;
    self.view.userInteractionEnabled = YES;
    [mainTabBar.tabBar setSelectedIndex:1];
    [self.viewDeckController toggleLeftViewAnimated:YES];

}
-(IBAction)btn_03_onClick:(id)sender
{
    [self btn_selected_no];
    btn_03.selected=YES;
//    btn_03.enabled=NO;
    self.viewDeckController.centerController = mainTabBar;
    self.view.userInteractionEnabled = YES;
    [mainTabBar.tabBar setSelectedIndex:2];
    [self.viewDeckController toggleLeftViewAnimated:YES];

}
-(IBAction)btn_04_onClick:(id)sender
{
    [self btn_selected_no];
    btn_04.selected=YES;
//    btn_04.enabled=NO;
    self.viewDeckController.centerController = mainTabBar;
    self.view.userInteractionEnabled = YES;
    [mainTabBar.tabBar setSelectedIndex:3];
    [self.viewDeckController toggleLeftViewAnimated:YES];
}
-(IBAction)btn_05_onClick:(id)sender
{
    [self btn_selected_no];
    btn_05.selected=YES;
//    btn_05.enabled=NO;
    self.viewDeckController.centerController = mainTabBar;
    self.view.userInteractionEnabled = YES;
    [mainTabBar.tabBar setSelectedIndex:4];
    [self.viewDeckController toggleLeftViewAnimated:YES];

}
-(IBAction)btn_06_onClick:(id)sender
{
//    MapServiceViewController *mapvc=[[MapServiceViewController alloc] initWithNibName:XIB_Version(@"MapServiceViewController")bundle:nil];
//    [self.app.viewDeckController.navigationController pushViewController:mapvc animated:YES];
    [self btn_selected_no];
    btn_06.selected=YES;
    //    btn_05.enabled=NO;
    self.viewDeckController.centerController = mainTabBar;
    self.view.userInteractionEnabled = YES;
    [mainTabBar.tabBar setSelectedIndex:5];
    [self.viewDeckController toggleLeftViewAnimated:YES];
}
-(IBAction)btn_07_onClick:(id)sender
{
    [self btn_selected_no];
    btn_07.selected=YES;
//    btn_07.enabled=NO;
//    AboutViewController *aboutVC = [[AboutViewController alloc] initWithNibName:XIB_Version(@"AboutViewController") bundle:nil];
//    [self.app.viewDeckController.navigationController pushViewController:aboutVC animated:YES];
    self.viewDeckController.centerController = mainTabBar;
    self.view.userInteractionEnabled = YES;
    [mainTabBar.tabBar setSelectedIndex:6];
    [self.viewDeckController toggleLeftViewAnimated:YES];
    
}
-(void)btn_selected_no
{
    btn_01.selected=NO;
    btn_02.selected=NO;
    btn_03.selected=NO;
    btn_04.selected=NO;
    btn_05.selected=NO;
    btn_06.selected=NO;
    btn_07.selected=NO;
}
@end
